package me.jiatao.mybatisstudy.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.sql.Timestamp;

//自动生成getter setter tostring
@Data

//描述：表名注解
@TableName(value = "USER_RED_PACKET", keepGlobalPrefix = true)
public class UserRedPacketPlus {
    //描述：主键注解
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private Long redPacketId;
    private Long userId;
    private Double amount;
    private Timestamp grabTime;

    /**
     * 默认填充
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String note;

    /**
     * 非数据库表中字段
     */
    @TableField(exist = false)
    private String otherThings;

    /**
     * 乐观锁
     * 修改时需要调用setVersion方法
     */
    @Version
    private int version;

    /**
     * 逻辑删除
     * 将delete 修改成 update
     */
    @TableLogic
    private Integer deleted;
}
